bytevector->string - transcode a bytevector to a string

LIBRARY

(import (rnrs))                     ;R6RS
(import (rnrs io ports))            ;R6RS

SYNOPSIS

(bytevector->string bytevector transcoder)

DESCRIPTION

Returns the string that results from transcoding bytevector according to the input direction of transcoder.

RETURN VALUES

Returns a single value; a string.

EXAMPLES

(bytevector->string #vu8(81 117 117 120) (native-transcoder))
        => "Quux"

(bytevector->string #vu8(#xff)
                    (make-transcoder (utf-8-codec)
                                     (native-eol-style)
                                     (error-handling-mode raise)))
        => &i/o-decoding

APPLICATION USAGE

This procedure is a more general alternative to utf8->string(3scm).

COMPATIBILITY

This procedure is unique to R6RS.

ERRORS

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
&i/o-decoding (R6RS)
A sequence of bytes was encountered that could not be translated into a string, and transcoder's error-handling-mode is raise.

SEE ALSO

string->bytevctor(3scm), utf8->string(3scm), open-bytevector-output-port(3scm), make-transcoder(3scm)

STANDARDS

R6RS

HISTORY

This procedure first appeared in R6RS as part of the redesigned I/O system.

AUTHORS

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/.


Markup created by unroff 1.0sc,    March 04, 2023.